package com.fz.us.oa.core.entity.com;

import com.fz.us.admin.company.entity.BaseFlowEntity;
import com.fz.us.admin.company.entity.User;
import com.fz.us.oa.core.entity.common.FileManage;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * Created by dzw on 2017/12/8.
 * 出差申请
 */
@Entity
@Table(name="ec_businessTravel")
public class BusinessTravel extends BaseFlowEntity {
    private static final long serialVersionUID = 6651368648985070932L;

    /**
     * 出差人员
     */
    private User travelUser;
    /**
     * 出差开始日期
     */
    private Date travelStartDate;
    /**
     * 出差结束日期
     */
    private Date travelEndDate;
    /**
     * 出差事由
     */
    private String reason;
    /**
     * 出差地点
     */
    private String address;
    /**
     * 费用预算
     */
    private BigDecimal money;
    /**
     * 是否完成 0未完成 1已完成
     */
    private int isFinished;
    /**
     * 是否完成出差 是 否
     */
    private String isComplete;
    /**
     * 未出差原因
     */
    private String failReason;
    /**
     * 未出差原因附件
     */
    private List<FileManage> failFile;
    /**
     * 出差小结
     */
    private String travelSummary;
    /**
     * 出差小结附件
     */
    private List<FileManage> summaryFile;

    @ManyToOne(fetch = FetchType.LAZY)
    public User getTravelUser() {
        return travelUser;
    }

    public void setTravelUser(User travelUser) {
        this.travelUser = travelUser;
    }

    public Date getTravelStartDate() {
        return travelStartDate;
    }

    public void setTravelStartDate(Date travelStartDate) {
        this.travelStartDate = travelStartDate;
    }

    public Date getTravelEndDate() {
        return travelEndDate;
    }

    public void setTravelEndDate(Date travelEndDate) {
        this.travelEndDate = travelEndDate;
    }

    public String getReason() {
        return reason;
    }

    public void setReason(String reason) {
        this.reason = reason;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public BigDecimal getMoney() {
        return money;
    }

    public void setMoney(BigDecimal money) {
        this.money = money;
    }

    public int getIsFinished() {
        return isFinished;
    }

    public void setIsFinished(int isFinished) {
        this.isFinished = isFinished;
    }

    public String getIsComplete() {
        return isComplete;
    }

    public void setIsComplete(String isComplete) {
        this.isComplete = isComplete;
    }

    public String getFailReason() {
        return failReason;
    }

    public void setFailReason(String failReason) {
        this.failReason = failReason;
    }

    public String getTravelSummary() {
        return travelSummary;
    }

    public void setTravelSummary(String travelSummary) {
        this.travelSummary = travelSummary;
    }

    @ManyToMany(fetch = FetchType.LAZY)
    @JoinTable(name = "ec_businessTravel_summaryFile", joinColumns = @JoinColumn(name="id"),inverseJoinColumns = @JoinColumn(name="fileId"))
    public List<FileManage> getSummaryFile() {
        return summaryFile;
    }

    public void setSummaryFile(List<FileManage> summaryFile) {
        this.summaryFile = summaryFile;
    }

    @ManyToMany(fetch = FetchType.LAZY)
    @JoinTable(name = "ec_businessTravel_failFile", joinColumns = @JoinColumn(name="id"),inverseJoinColumns = @JoinColumn(name="fileId"))
    public List<FileManage> getFailFile() {
        return failFile;
    }

    public void setFailFile(List<FileManage> failFile) {
        this.failFile = failFile;
    }
}
